<template>
  <router-view :class="[mode]" />
</template>
<script setup lang="ts">
import { computed, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import config from '@/config/style';
import { getPermissionStore, getUserStore, useSettingStore } from '@/store';

const store = useSettingStore();

const mode = computed(() => {
  return store.displayMode;
});
const router = useRouter();
const permissionStore = getPermissionStore();
const userStore = getUserStore();
onMounted(() => {
  userStore.getUserInfo().then((user) => {
    permissionStore.initRoutes(user.permissions);
  });
  store.updateConfig({ ...config });
});
</script>
<style lang="less" scoped>
@import '@/style/variables.less';

#nprogress .bar {
  background: var(--tdvns-brand-color) !important;
}
</style>
